package struct;
public class Rule implements Cloneable {
    Term left, right;

    public Rule(Term left, Term right) {
        super();
        this.left = left;
        this.right = right;
    }

    public Term getLeft() {
        return left;
    }

    public void setLeft(Term left) {
        this.left = left;
    }

    public Term getRight() {
        return right;
    }

    public void setRight(Term right) {
        this.right = right;
    }
    
    public String toString()
    {
        StringBuffer sbuf = new StringBuffer();
        sbuf.append(left).append(" -> ").append(right);
        
        return sbuf.toString();
    }
    
    public boolean equals(Object rule)
    {
        boolean ret = false;
        if (rule != null && rule instanceof Rule)
        {
            if (((Rule)rule).getLeft().equals(left) && ((Rule)rule).getRight().equals(right))
            {
                ret = true;
            }
        }
        return ret;
    }
    
    public Object clone()
    {
    	return new Rule((Term)left.clone(), (Term)right.clone());
    }
}
